package com.hz.house.token;

/**
 * 存储请求携带的用户ID
 * @author lfw
 */
public class CurrentUser {

	private static ThreadLocal<Integer> currentUserId = new ThreadLocal<>();
	
	
	/**当前线程绑定用户id*/
	public static void setCurrentUserId(Integer uid) {
		currentUserId.set(uid);
	}
	
	public static void clearCurrentUserId() {
		currentUserId.remove();
	}
	
	public static Integer getCurrentUserId() {
		return currentUserId.get();
	}
	
}
